//
//  ipjsua_app_callback.h
//  ipjsua
//
//  Created by longzhiyuan on 15/4/23.
//  Copyright (c) 2015年 Teluu. All rights reserved.
//

#ifndef __ipjsua__ipjsua_app_callback__
#define __ipjsua__ipjsua_app_callback__

#include <stdio.h>


class PjsuaAppCallback {
public:
    virtual ~PjsuaAppCallback() {}
    virtual void onStarted(const char *msg) ;
    virtual void onStopped(int restart) ;
    virtual void onregstate(int isreg, int regcode) ;
    virtual void onincomingcall(const char * url) ;
    virtual void oncallstate(int recode) ;
    virtual void onpager(const char *user, const char * msg) ;
    virtual void ontyping(const char * user) ;
    virtual void ontransportstate(int state, const char * addr) ;
};


int pjsuaStart();
void pjsuaDestroy();
void pjsuaSetRegAddr(const char * addr, int port);
void pjsuaSetUser(const char *username, const char *password);
void pjsuaMakeCall(const char *callnum);
void pjsuaHangup(bool isall);
int pjsuaRestart();
void setCallbackObject(PjsuaAppCallback* callback);
void pjsuaSetLogf(int level, const char * filename);



#endif /* defined(__ipjsua__ipjsua_app_callback__) */
